#include "Object.h"

bool AObject::Fill_Particle(CDraw &para, AnalyseClass &analyse){
	para.debug.Message(3,20,"in the Fill_Particle: begin ");
	int iter=0;
	// all jet number in this event
	analyse.var.var[iter].variable =  Vjet.size(); 
	iter++;
	// tagjet, jet used in the next combine part
	analyse.var.var[iter].variable =  Lsignal_tagjet.size(); 
	iter++;
	para.debug.Message(3,20,"in the Fill_Particle: tagjet ");
	if( Lsignal_tagjet.size()>=para.signal.NUM_jets){
		for( int i=0;i<Lsignal_tagjet.size();i++){
			analyse.var.var[iter].variable =  Lsignal_tagjet   [i].Pt(); 
			iter++;
			analyse.var.var[iter].variable =  Lsignal_tagjet   [i].Eta(); 
			iter++;
		}
	}
	// all elec number in this event
	para.debug.Message(3,20,"in the Fill_Particle: leptons");
	analyse.var.var[iter].variable = Velec.size(); 
	iter++;
	// all muon number in this event
	analyse.var.var[iter].variable = Vmuon.size(); 
	iter++;
	// all lep number in this event
	analyse.var.var[iter].variable = Velec.size()+Vmuon.size(); 
	iter++;
	// tagjet, jet used in the next combine part
	analyse.var.var[iter].variable =  Lsignal_lep.size(); 
	iter++;
	if( Lsignal_lep.size()>=para.signal.NUM_lep){
		for( int i=0;i<Lsignal_lep.size();i++){
			analyse.var.var[iter].variable =  Lsignal_lep   [i].Pt(); 
			iter++;
			analyse.var.var[iter].variable =  Lsignal_lep   [i].Eta(); 
			iter++;
		}
	}
	// photons 
	para.debug.Message(3,20,"in the Fill_Particle: photons");
	analyse.var.var[iter].variable =  Lsignal_photon.size(); 
	iter++;
	if( Lsignal_photon.size()>=para.signal.NUM_photon){
		for( int i=0;i<Lsignal_photon.size();i++){
			analyse.var.var[iter].variable =  Lsignal_photon   [i].Pt(); 
			iter++;
			analyse.var.var[iter].variable =  Lsignal_photon   [i].Eta(); 
			iter++;
		}
	}
	// met 
	para.debug.Message(3,20,"in the Fill_Particle: met");
	if(para.met.SWITCH){
		analyse.var.var[iter].variable =  Lmet   [0].Pt(); 
		iter++;
	}
	// vis 
	para.debug.Message(3,20,"in the Fill_Particle: vis");
	analyse.var.var[iter].variable =  Lvis   [0].M(); 
	iter++;
	analyse.var.var[iter].variable =  Lvis   [0].Pt(); 
	iter++;
	analyse.var.var[iter].variable =  Lvis   [0].Eta(); 
	iter++;

	para.global.Fill_Iter=iter;


	return(true);
}
